using BlogExample.Core.Domain;
using BlogExample.Core.Services;
using FubuMVC.Tests;
using NUnit.Framework;

namespace BlogExample.Tests.Services
{
	[TestFixture]
	public class InstructorDisplayStrategyTester
	{
		private InstructorDisplayStrategy _strategy;

		[SetUp]
		public void Setup()
		{
			_strategy = new InstructorDisplayStrategy();
		}

		[Test]
		public void should_match_on_instructor_entity()
		{
			_strategy.Matches(new Instructor()).ShouldBeTrue();
		}

		[Test]
		public void should_not_match_on_non_instructor_objects()
		{
			_strategy.Matches(new Course()).ShouldBeFalse();
		}

		[Test]
		public void should_return_description_and_appended_title_for_the_instructor()
		{
			var course = new Instructor() { Name = "Skippy" };
			_strategy.GetEntityDescription(course).ShouldEqual("Professor Skippy");
		}
	}
}